﻿<catel:DataWindow x:Class="Caitlyn.Views.SelectProjectsView"
                  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
			      xmlns:catel="http://catel.codeplex.com" 
                  Width="400" Height="600">
    
    <!-- Resources -->
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Catel.Extensions.Controls;component/themes/generic.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>

    <!-- Content -->
    <catel:StackGrid>
		<catel:StackGrid.RowDefinitions>
			<RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
			<RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
		</catel:StackGrid.RowDefinitions>
        
        <catel:StackGrid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="*" />
        </catel:StackGrid.ColumnDefinitions>

        <Label Content="Root project:" />
        <ComboBox ItemsSource="{Binding AvailableProjects}" SelectedItem="{Binding RootProject, ValidatesOnDataErrors=True, NotifyOnValidationError=True}"
                  DisplayMemberPath="Name"/>
                  
        <Label catel:StackGrid.ColumnSpan="2" Content="Please select the projects that should link files to the root project" />
        <ItemsControl catel:StackGrid.ColumnSpan="2" ItemsSource="{Binding SelectableProjects}">
            <ItemsControl.ItemTemplate>
                <DataTemplate>
                    <StackPanel Orientation="Horizontal">
                        <CheckBox IsChecked="{Binding IsChecked}" Content="{Binding Name}" />
                    </StackPanel>
                </DataTemplate>
            </ItemsControl.ItemTemplate>
        </ItemsControl>

        <GroupBox catel:StackGrid.ColumnSpan="2" Header="Options">
            <StackPanel>
                <CheckBox IsChecked="{Binding RemoveMissingFiles}" Content="Remove linked files that do not existing in the root project" />
            </StackPanel>
        </GroupBox>
    </catel:StackGrid>
</catel:DataWindow>
